#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	char a;
	int x = 0;
	int y = 0;
	while((a = getwchar())!=EOF)
	{
		if (a == 'A')
		{
			x++;
		}
		else if (a == 'B')
		{
			y++;
		}
	}
	if (x > y)
	{
		printf("A\n");
	}
	else if (x < y)
	{
		printf("B\n");
	}
	else
		printf("E\n");
	return 0;
}